package org.lds.hotkey.console.business.currhotkey.service.impl;

import org.lds.hotkey.common.model.dto.ResultDTO;
import org.lds.hotkey.console.business.currhotkey.service.CurrHotKeyBaseService;
import org.lds.hotkey.console.business.currhotkey.service.CurrHotKeyRemoteService;
import org.lds.hotkey.console.remote.model.request.BatchCurrHotKeySaveRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CurrHotKeyRemoteServiceImpl implements CurrHotKeyRemoteService {

    @Autowired
    private CurrHotKeyBaseService currHotKeyBaseService;

    @Override
    public ResultDTO<Boolean> saveCurrHotKey(BatchCurrHotKeySaveRequest request) {
        request.getRequests().forEach(currHotKeySaveRequest -> currHotKeyBaseService.saveCurrHotKey(currHotKeySaveRequest));
        return ResultDTO.success(true);
    }
}
